package com.kefu.call.vo;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.vo.AbstractSearchVo;
import com.kefu.call.model.CdrCustomer;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2022/07/28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "计费_计费客户")
public class CdrCustomerSearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "余额")
    private String balance;
    @ApiModelProperty(value = "透支限额")
    private String overdraft;
    @ApiModelProperty(value = "公司id")
    private String company;

	 @Override
    public  LambdaQueryWrapper<CdrCustomer> lambdaQuery(){
    	LambdaQueryWrapper<CdrCustomer> wrapper=Wrappers.<CdrCustomer>lambdaQuery();
	    wrapper.eq(StringUtils.isNotBlank(name), CdrCustomer::getName, name);//名称
	    wrapper.eq(StringUtils.isNotBlank(balance), CdrCustomer::getBalance, balance);//余额
	    wrapper.eq(StringUtils.isNotBlank(overdraft), CdrCustomer::getOverdraft, overdraft);//透支限额
	    wrapper.eq(StringUtils.isNotBlank(company), CdrCustomer::getCompany, company);//来区分代理商还是普通用户
         wrapper.eq(CdrCustomer::getBshowFlag,1);
    	return wrapper;
	}
}